package com.lijun.SpringBootJavaFX.service.serviceImpl.system;

import com.lijun.SpringBootJavaFX.model.system.SystemCode;
import com.lijun.SpringBootJavaFX.service.system.SystemCodeService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class SystemCodeServiceImpl implements SystemCodeService {

    private String[] interestNameArr = new String []{"阅读","看电影","运动","旅行","美容","美食","聊天","抽烟","喝酒","跳舞","唱歌","打游戏","玩手机",
            "工作","学习","武术","爬山","篮球","足球","排球","乒乓球","羽毛球","弹球","射箭","踢毽子"};
    private String[] interestCodeArr = new String []{"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25"};


    private String[] eduNameArr = new String []{"研究生","本科","专科","高中","初中","小学"};
    private String[] eduCodeArr = new String []{"1","2","3","4","5","6"};

    @Override
    public List<SystemCode> getSysteCodeListByCodeType(String codeType) {
        List<SystemCode> codeList = new ArrayList<>();
        if ("INTEREST".equals(codeType)) {
            for (int i = 0; i < interestNameArr.length; i++) {
                SystemCode code = new SystemCode();
                String interestName = interestNameArr[i];
                String interestCode = interestCodeArr[i];
                code.setCode(interestCode);
                code.setName(interestName);
                code.setCodeType("INTEREST");
                codeList.add(code);
            }
        }else if("EDU".equals(codeType)){
            for (int i = 0; i < eduNameArr.length; i++) {
                SystemCode code = new SystemCode();
                String interestName = eduNameArr[i];
                String interestCode = eduCodeArr[i];
                code.setCode(interestCode);
                code.setName(interestName);
                code.setCodeType("EDU");
                codeList.add(code);
            }
        }
        return codeList;
    }
}
